#ifndef STUDENTWINDOW_H
#define STUDENTWINDOW_H

#include <QMainWindow>
#include <QPushButton>
#include <QLabel>
#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>

// 前向声明
class VideoReceiver;
class RemoteExecutor;
class ScreenCapture;

class StudentWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit StudentWindow(QWidget *parent = nullptr);
    ~StudentWindow();

private slots:
    // 核心功能
    void startReceiving();
    void stopReceiving();
    void toggleRemoteControl();
    
    // 远程控制相关槽函数
    void onRemoteControlEnabled();
    void onRemoteControlDisabled();
    void onRemoteControlCommandExecuted(const QString& commandInfo);
    void onRemoteControlCommandReceived(const QString& commandInfo);
    void onRemoteControlError(const QString& error);
    
    // 屏幕共享相关槽函数
    void toggleScreenSharing();
    void onScreenSharingStarted();
    void onScreenSharingStopped();
    void onScreenSharingError(const QString& error);

private:
    void setupUI();
    void setupConnections();

private:
    // 核心功能模块
    VideoReceiver* videoReceiver;
    RemoteExecutor* remoteExecutor;
    ScreenCapture* screenCapture;
    
    // 简化的UI组件
    QWidget* centralWidget;
    QVBoxLayout* mainLayout;
    
    // 视频显示区域
    QWidget* videoDisplayArea;
    
    // 核心控制按钮
    QPushButton* startReceiveButton;
    QPushButton* stopReceiveButton;
    QPushButton* remoteControlButton;
    QPushButton* screenShareButton;
    QLabel* statusLabel;
    QLabel* screenShareStatusLabel;
    
    // 控制变量
    bool isReceiving;
    bool isRemoteControlEnabled;
    bool isScreenSharing;
};

#endif // STUDENTWINDOW_H
